<template>
  <div id='bookMall'>
    <com-head :opacity='0'>书城</com-head>
    <div class="nav">
      <div class="box" :class="{active: active === '1'}" @click="booklist">书籍</div>
      <div class="box" :class="{active: active === '2'}" @click="Ebooklist">电子书</div>
    </div>
    <div class="sellwell">
      <div class="bookList" v-for="(item,index) in bookList" :key="index">
        <div class="left"><img :src="item.book" ></div>
        <div class="right">
          <div class="name">{{item.name}}</div>
          <div class="abstract">{{item.abstract}}</div>
          <div class="pagenum">共{{item.pagenum}}章</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "bookMall",
  data() {
    return {
      active: "1",
      bookList: [
        {
          book: require("../assets/image/img/book2.png"),
          name: "白鹿原",
          abstract: "这个书不错哦",
          pagenum: "88"
        },
        {
          book: require("../assets/image/img/book4.png"),
          name: "白鹿原",
          abstract: "这个书不错哦",
          pagenum: "88"
        }
      ]
    };
  },

  computed: {},

  created() {},

  mounted() {},

  methods: {
    booklist() {
      this.active = "1";
    },
    Ebooklist() {
      this.active = "2";
    }
  }
};
</script>
<style lang='scss' scoped>
#bookMall {
  padding-top: 88px;
  .nav {
    height: 90px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    border-bottom: 4px solid rgba(65, 215, 189, 1);
    color: rgba(65, 215, 189, 1);
    .box {
      width: 264px;
      height: 60px;
      margin-right: 10px;
      border-radius: 10px 10px 0px 0px;
      text-align: center;
      line-height: 60px;
      border: 1px solid rgba(65, 215, 189, 1);
      border-bottom: none;
    }
    .active {
      background: rgba(65, 215, 189, 1);
      color: #fff;
    }
  }
  .sellwell {
    margin-top: 20px;
    background-color: #fff;
    padding: 0 32px;
    .sellTop {
      display: flex;
      color: #41d7bd;
      justify-content: space-between;
      align-content: center;
      line-height: 84px;
      position: relative;
      span {
        color: #333333;
      }
      span:nth-of-type(1) {
        font-weight: 700;
      }
      &:after {
        content: "";
        height: 28px;
        width: 2px;
        background: #555;
        position: absolute;
        left: -8px;
        top: 27px;
      }
    }
    .bookList {
      height: 340px;
      border-bottom: 1px solid #f6f6f6;
      display: flex;
      justify-content: space-between;
      .left {
        width: 200px;
        height: 260px;
        border-radius: 6px;
        margin-top: 40px;
        border: 1Px solid #eee;
        img {
          width: 100%;
          height: 100%;
        }
      }
      .right {
        width: 458px;
        height: 240px;
        margin-top: 60px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        font-size: 26px;
        color: rgba(153, 153, 153, 1);
        .name {
          color: #222;
          font-size: 30px;
        }
        .abstract {
          height: 200px;
          display: -webkit-box;
          -webkit-box-orient: vertical;
          -webkit-line-clamp: 3;
          overflow: hidden;
        }
      }
    }
  }
}
</style>